#http://blog.csdn.net/sharonmei1219/article/details/8719878
CXX=g++

OBJDIR=./obj
SRCDIR=..
SOURCE_TMP := $(wildcard ${SRCDIR}/*.cpp)
SOURCE := ${filter-out %HiFiLES.cpp, ${SOURCE_TMP}}
SRCOBJ := $(SOURCE:${SRCDIR}/%.cpp=${OBJDIR}/%.o)
MAINSDIR=.

INC_DIRS=../../include
CXXFLAGS = $(addprefix -I,$(INC_DIRS))
EXTRA_CXXFLAGS= -g #-Wall

APPNAME=exe

all:${APPNAME}

${APPNAME}:${SRCOBJ} ${OBJDIR}/test_Blasius.o
	${CXX} ${SRCOBJ} ${OBJDIR}/test_Blasius.o -o ${APPNAME} ${CXXFLAGS} ${EXTRA_CXXFLAGS}

${SRCOBJ}:${OBJDIR}/%.o:${SRCDIR}/%.cpp
	${CXX} -c $< -o $@ ${CXXFLAGS} ${EXTRA_CXXFLAGS}

${OBJDIR}/test_Blasius.o:${OBJDIR}/%.o:${MAINSDIR}/%.cpp
	${CXX} -c $< -o $@ ${CXXFLAGS} ${EXTRA_CXXFLAGS}

clean:
	find ${OBJDIR} -name "*.o" -o -name "${APPNAME}" |xargs rm ; rm ${APPNAME}
